// import axios from 'axios'
// 导入请求
import request from '@/utils/request.js'
// axios.defaults.baseURL = process.env.VUE_APP_URL

export function authorizationsPost (data) {
  return request({
    url: '/v1_0/authorizations',
    method: 'post',
    data
  })
}

export function getUserInfo () {
  return request({
    url: '/v1_0/user/profile'
    // headers: {
    //   Authorization: `Bearer ${getItem()}`
    // }
  })
}

export function channel () {
  return request({
    url: '/v1_0/channels'
  })
}

export function article (params) {
  return request({
    url: '/v1_0/mp/articles',
    params
  })
}
export function articlePost (data, draft) {
  return request({
    url: '/v1_0/mp/articles',
    method: 'post',
    params: { draft },
    data
  })
}
export function articleDelete (id) {
  return request({
    url: '/v1_0/mp/articles/' + id,
    method: 'delete'
  })
}
export function articleGet (id) {
  return request({
    url: '/v1_0/mp/articles/' + id
  })
}
export function articlePut (data, draft, id) {
  return request({
    url: '/v1_0/mp/articles/' + id,
    method: 'put',
    params: { draft },
    data
  })
}
